/***********************************************************************/
/*   Copyright Mentor Graphics Corporation 2012 All Rights Reserved.   */
/*                                                                     */
/*     THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION     */
/*     WHICH IS THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS     */
/*             LICENSORS AND IS SUBJECT TO LICENSE TERMS.              */
/***********************************************************************/

define(
   [
      'dojo/_base/declare'
   ],
   function(declare)
   {
      var pMe = declare(null,
      {
      });
      pMe.getTopWindow = function(win)
      {
         if(!win) win = window;
         if(win.parent === win)
            return win;

         try 
         {
            win.parent.document;
         }
         catch(e)
         {
            return win;
         }

         return pMe.getTopWindow(win.parent);
      };
      pMe.top = pMe.getTopWindow();
      return pMe;
   }
);
